<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>前置机状态</title>
<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/static/jquery-easyui-1.3.5/themes/default/easyui.css">
<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/static/jquery-easyui-1.3.5/themes/icon.css">
<script type="text/javascript" src="${pageContext.request.contextPath}/static/jquery-easyui-1.3.5/jquery.min.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/static/jquery-easyui-1.3.5/jquery.easyui.min.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/static/jquery-easyui-1.3.5/locale/easyui-lang-zh_CN.js"></script>
<script type="text/javascript">
function searchFrontProcessorInfoAndFrontProcessorState(){
	var frontProcessor_id = $("#frontProcessor_id").combobox("getValue");
	console.log("frontProcessor_id: " + frontProcessor_id);
	if(frontProcessor_id==""){
		$("#dg").datagrid('load',{
		});
	}else{
		$("#dg").datagrid('load',{
			"frontProcessorId":frontProcessor_id
			});
		}
}
function formatDatebox(value){  
	var time = value.split("故障时间：")[1];
    var datetimeType = "";
    var date = new Date(time-0);
    if (date == null) return "";
    datetimeType = date.getFullYear()+"-"+(date.getMonth()+1)+"-"+date.getDate() +" "+date.getHours()+":"+date.getMinutes()+":"+date.getSeconds();
    if (datetimeType.indexOf("NaN") != -1) return "";
    return datetimeType;
} 
function formatFrontProcessorId(row) {
	var s = '<span style="font-weight:bold">' + row.siteName + '</span><br/>'
			+ '<span style="color:#888">' + row.frontProcessorId + '</span>';
	return s;
}
function onLoadComboboxSuccess() {
    var val = $(this).combobox("getData");
    for (var item in val[0]) {
        if (item == "siteName") {
            $(this).combobox("select", val[0][item]);
            initialFrontProcessorId = val[0][item];
        }
    }
}

</script>
</head>
<body style="margin: 1px">
<table id="dg" title="前置机状态" class="easyui-datagrid"
   fitColumns="true" pagination="true" rownumbers="true" pageList="[50,100]" pageSize="50"
   url="${pageContext.request.contextPath}/frontProcessorState/statelist.do" fit="true" toolbar="#tb" singleSelect="true">
   <thead>
   	<tr>
   		<th field="cb" checkbox="true" align="center"></th>
   		<th field="frontProcessorId" width="80" align="center">前置机号</th>
   		<th field="siteName" width="80" align="center">小区名</th>
   		<th field="ipAddress" width="80" align="center">部署地址</th>
   		<th field="bcchInfo" width="50" align="center">BCCH</th>
   		<th field="hardwareVersion" width="50" align="center">硬件版本号</th>
   		<th field="softwareVersion" width="100" align="center">软件版本号</th>
   		<th field="cpuUsageRate" width="100" align="center">最近CPU使用率%</th>
   		<th field="memoryUsageRate" width="100" align="center">最近内存使用率%</th>
   		<th field="harddiskUsageRate" width="100" align="center">最近硬盘使用率%</th>
   		<!-- <th field="alarmInfo" width="100" align="center" >最近故障信息</th> -->
   		<th field="alarmInfo" width="100" align="center" formatter="formatDatebox">时间</th>
   	</tr>
   </thead>
 </table>
 <div id="tb">
 	<div>
 		<%-- &nbsp;前置机：&nbsp;
 		<input class="easyui-combobox" id="frontProcessor_id" size="20" name="frontProcessorId" data-options="panelHeight:'130',valueField:'frontProcessorId',textField:'siteName',url:'${pageContext.request.contextPath}/frontProcessorInfo/frontProcessorIdAndSiteNameComboList.do',formatter: formatFrontProcessorId"/> 
 		<a href="javascript:searchFrontProcessorInfoAndFrontProcessorState()" class="easyui-linkbutton" iconCls="icon-search" plain="true"><b style="font-size:15px">搜索</b></a> --%>
 	</div>
 </div>
 
</body>
</html>